home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- //
- // Creation Date: October 29, 1999
- // Author: Bruce Hickey
- //
- // Procedure Name:
- // AErenderLayerNoScroll
- //
- // Description Name;
- // Creates the attribute editor controls for the renderLayer Node
- //
- // Input Value:
- // nodeName
- //
- // Output Value:
- // None
- //
-
- global proc changeRenderLayerNumber ( string $id )
- {
- string $parent = `setParent -q`;
- int $idValue = `intFieldGrp -q -v1 renderLayerNumberField`;
-
- // If this layer is connected to the render layer manager, which all
- // layers should be, then that is the field we want to edit. (It is
- // not available in the render layer manager attribute editor.)
- //
- // This hides the implementation of the id from the user.
- //
- string $cmd = ("listConnections -d on -p on " + $id);
- string $srcList[] = `eval $cmd`;
- if( size($srcList) > 0 )
- {
- if( catch(`setAttr $srcList[0] $idValue`) )
- {
- updateRenderLayerNumber( $parent, $id );
- }
- }
- else
- {
- // If no connection then try to set it directly
- //
- if( catch(`setAttr $id $idValue`) )
- {
- updateRenderLayerNumber( $parent, $id );
- }
- }
- }
-
- global proc updateRenderLayerNumber (string $parent, string $id)
- {
- intFieldGrp -e -v1 `getAttr $id` ($parent + "|renderLayerNumberField");
- }
-
- //
- // Procedure Name:
- // renderLayerNumberNew
- //
- global proc renderLayerNumberNew ( string $id )
- {
- setUITemplate -pst attributeEditorTemplate;
- intFieldGrp -l "Number" -v1 0
- -cc ("changeRenderLayerNumber " + $id)
- renderLayerNumberField;
- setUITemplate -ppt;
-
- renderLayerNumberReplace $id;
- }
-
-
- //
- // Procedure Name:
- // renderLayerNumberReplace
- //
- //
- global proc renderLayerNumberReplace (string $id)
- {
- intFieldGrp -e -cc ("changeRenderLayerNumber " + $id)
- renderLayerNumberField;
-
- string $parent = `setParent -q`;
- scriptJob -p $parent -rp -attributeChange $id
- ("updateRenderLayerNumber "+$parent+" "+$id);
-
- updateRenderLayerNumber( $parent, $id );
-
- // Disable the number for the default layer. It is not allowed to change.
- //
- int $value = 1;
- string $mgr[] = `ls -type renderLayerManager`;
- if( size($mgr) > 0 )
- {
- string $def[]=`listConnections -p on ($mgr[0] + ".renderLayerId[0]")`;
- if( (size($def) > 0)
- && ($def[0] == $id) )
- {
- $value = 0;
- }
- }
- intFieldGrp -e -en ($value) renderLayerNumberField;
- }
-
- //
- // Procedure Name:
- // AErenderLayerTemplate
- //
-
- global proc AErenderLayerNoScroll ( string $nodeName )
- {
- editorTemplate -beginLayout "Render Layer Options" -collapse 0;
- editorTemplate -addControl "renderable";
- editorTemplate -addControl "displayOrder";
- //editorTemplate -addControl "drawColor";
-
- editorTemplate -beginLayout "Render Pass Options" -collapse 1;
- editorTemplate -addControl "beauty";
- editorTemplate -addControl "color";
- editorTemplate -addControl "shadow";
- editorTemplate -suppress "ambient";
- editorTemplate -addControl "diffuse";
- editorTemplate -addControl "specular";
- editorTemplate -endLayout;
-
- editorTemplate -endLayout;
-
-
- // suppressed attributes
-
- editorTemplate -suppress "identification";
- editorTemplate -suppress "renderPassInfo";
- editorTemplate -suppress "renderInfo";
-
-
- // include/call base class/node attributes
-
- AEdependNodeTemplate $nodeName;
- }
-